﻿;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;; Charter Level Up        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; make sure paste_hotkey resolves to disabled when blank

;###############################################################################
;##     Beginning of Auto Execute §  ( § = Section )                          ##
;###############################################################################  
#NoEnv ; For performance. Doesn't fill default OS variables until encoutered
SendMode Input ; Recommended due to its superior speed and reliability
#SingleInstance,Force ; one instance only, skips "Already running Dialogue" 

applicationname:=a_scriptname
version:=v70220 
What_it_does = 
(
 Implements functions to improve productivity for Charter Reps
 Including:
 • Timestamp and user name pasting for both billing systems
 • Easy call wrap writer

 • Creates PSP right click menu that helps input all commands
 
 • Automatically copies everything that is highlighted or double-clicked (No 
    more need for Ctrl+C or RClick+Copy)

 • Store all copied information in an easy to navigate pop-up window that will 
    easily paste older "copies"

 • Middle/Wheel click will paste current copied text if nothing is highlighted

 ■ Middle/Wheel click on highlighted text for a menu of websites to submit 
    highlighted word(s) to( Such as Google Wikipedia ect.,).
 
 ■ Automatically replaces typos with correct word. List from wikipedia.org 
    Link: http://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings

 ■ Expands abbreviations to their full text to shorten typing time (ie., typing
    "hgd" produces "have a great day")

 ■ Control & Caps lock will change any highlighted text to upper/lower case

 ■ Pressing letters A-Z while holding Shift cancels Caps lock to avoid 
    reverse title case

 ■ Additional Keyboard shortcuts for common task and some web-based tools (ie.,
    "Marks Page" and Call wrap writer)

 !!Also Featuring!!
 Note Logger - to help techs keep call notes and other important info 
 throughout the day:

 ■ Ability to lock to the bottom of the screen and stay on top of all other 
    windows without covering anything

 ■ Call notes stored on a "rotating" text document that is stored in 
    "made on-the-fly" year and month folders

 ■ Search through customer logs for any search string

 ■ Automatically copy sales (if tagged with two "$" signs) into a monthly sales 
    report

 ■ Includes three timer functions:

 	- Adjustable minute count down timer for reminders (preset to 3min. 
	  for hold procedure)

	- Log-in/Log-out recording feature informs the tech when to return 
          from break and creates a monthly report

	- Follow up feature that creates an outlook reminder with note for 
          customer follow up at a given date and time
)

Gosub INIREAD
Gosub,TRAYMENU
  
If start_disabled 
  Gosub,SWAPSTATUS

If start_with_win 
    IfNotExist %A_Startup%\%applicationname%.lnk
	FileCreateShortcut 
,%A_Scriptfullpath%,%A_Startup%\%applicationname%.lnk,%A_Scriptdir%,,,,

If tag_stamp 
   Hotkey Capslock & t,On 

If user_name 
  tag_info := ":%uppername%:"

If time_stamp 
  tag_info := ":%stampdatetime%:"

If user_name and time_stamp
  tag_info := ":%stampdatetime% -%uppername%:"

If call_wrapper
   IsLabel(CALLWRAPPER)
      Gosub CALLWRAPPER

If psp_menu
   IsLabel(PSPMENU)
      Gosub PSPMENU

If copy_highlighted
   IsLabel(COPYHIGHLIGHTED)
      Gosub COPYHIGHLIGHTED

If clip_boardhelper
   IsLabel(CLIPBOARDHELPER)
      Gosub CLIPBOARDHELPER

If paste_hotkey
  Hotkey,%paste_hotkey%,PASTE,On UseErrorLevel

If togglehotkey
  Hotkey,%togglehotkey%,SWAPSTATUS,On UseErrorLevel

If middle_click_search
   IsLabel(MIDDLECLICKSEARCH)
      Gosub MIDDLECLICKSEARCH

If typos
   IsLabel(TYPOS)
      Gosub TYPOS

If abbreviations
   IsLabel(ABBREVIATIONS)
      Gosub ABBREVIATIONS

;If togglecase
;Hotkey Capslock,On

If smartcapslock 
   IsLabel(RevTITLECASEDISABLE)
      Gosub RevTITLECASEDISABLE

;If varioushotkey


If note_logger
   IsLabel(Note_Logger)
      Gosub Note_Logger

If note_logger_reserve_screen
   IsLabel(WORKLOGGERRESERVESCREEN)
      Gosub WORKLOGGERRESERVESCREEN

;setting for default minutes on timer
;setting for lunch and break times
Return

;###############################################################################
;##     End of Auto Execute §                                                 ##
;##     ------------------------------------                                  ##
;##     Begin Hot Key and Hot String §                                        ##
;###############################################################################

Capslock & t::
FormatTime,stampdatetime, lsys, ddd M/d/yy h:mm tt 
StringUpper,uppername,a_username
SendInput := tag_info
return

;###############################################################################
;##     End of Hot Key and Hot String §                                       ##
;##     ------------------------------------                                  ##
;##     Begin SubRoute §                                                      ##
;###############################################################################

;#############################
	;     Build & Read ini §
;#############################

INIREAD:  
IfNotExist,%applicationname%.ini
{ 
; sets default variables for .ini file
  start_disabled=false
  start_with_win=true
  tag_stamp=true
  user_name=true
  time_stamp=true 
  call_wrapper=true
  psp_menu=true
  copy_highlighted=true
  clip_boardhelper=true
  paste_hotkey=~MButton
  togglehotkey=
  middle_click_search=true
  typos=true
  abbreviations=true
  capslock_change_case=true
  smartcapslock=true
  various_hotkeys=listect
  note_logger=true
  note_logger_reserve_screen=true
  minute_timer_start_at=3
  lunch_length=60
  break_length=15
  Gosub,INIWRITE
  Gosub,ABOUT
}
IniRead,start_disabled,%applicationname%.ini,Settings,start_disabled
IniRead,start_with_win,%applicationname%.ini,Settings,start_with_win
IniRead,tag_stamp,%applicationname%.ini,Settings,tag_stamp
IniRead,user_name,%applicationname%.ini,Settings,user_name
IniRead,time_stamp,%applicationname%.ini,Settings,time_stamp
IniRead,call_wrapper,%applicationname%.ini,Settings,call_wrapper
IniRead,psp_menu,%applicationname%.ini,Settings,psp_menu
IniRead,copy_highlighted,%applicationname%.ini,Settings,copy_highlighted
IniRead,clip_boardhelper,%applicationname%.ini,Settings,clip_boardhelper
IniRead,paste_hotkey,%applicationname%.ini,Settings,paste_hotkey
IniRead,togglehotkey,%applicationname%.ini,Settings,togglehotkey
IniRead,middle_click_search,%applicationname%.ini,Settings,middle_click_search
IniRead,typos,%applicationname%.ini,Settings,typos
IniRead,abbreviations,%applicationname%.ini,Settings,abbreviations
IniRead,capslock_change_case,%applicationname%.ini
,Settings,capslock_change_case 
IniRead,smartcapslock,%applicationname%.ini,Setings,smartcapslock
IniRead,various_hotkeys,%applicationname%.ini,Settings,varioushotkeys
IniRead,note_logger,%applicationname%.ini,Settings,note_logger
IniRead,note_logger_reserve_screen,%applicationname%.ini
,Settings,note_logger_reserve_screen
IniRead,minute_timer,%applicationname%.ini,Settings,minute_timer
IniRead,lunch_length,%applicationname%.ini,Settings,lunch_length
IniRead,break_length,%applicationname%.ini,Settings,break_length

; Resets variables in settings file so that the "false" and "true" can be used
start_disabled:=%start_disabled%
start_with_win:=%start_with_win%
tag_stamp:=%tag_stamp%
user_name:=%user_name%
time_stamp:=%time_stamp%
call_wrapper:=%call_wrapper%
psp_menu:=%psp_menu%
copy_highlighted:=%copy_highlighted%
clip_boardhelper:=%clip_boardhelper%
middle_click_search:=%middle_click_search%
typos:=%typos%
abbreviations:=%abbreviations%
capslock_change_case:=%capslock_change_case%
smartcapslock:=%smartcapslock%
note_logger:=%note_logger%
note_logger_reserve_screen:=%note_logger_reserve_screen%
minute_timer_start_at:=%minute_timer_start_at%
lunch_length:=%lunch_length%
break_length:=%break_length%

;;;;; Set other variables ;;;;;

Hotkey,Capslock & t, Off  

If start_with_win = false
   IfExist %A_Startup%\%applicationname%.lnk
      Filedelete,%A_Startup%\%applicationname%.lnk
Return

INIWRITE:
IniWrite,%start_disabled%,%applicationname%.ini,Settings,start_disabled
IniWrite,%start_with_win%,%applicationname%.ini,Settings,start_with_win
IniWrite,%tag_stamp%,%applicationname%.ini,Settings,tag_stamp
IniWrite,%username%,%applicationname%.ini,Settings,username
IniWrite,%timestamp%,%applicationname%.ini,Settings,timestamp
IniWrite,%call_wrapper%,%applicationname%.ini,Settings,call_wrapper
IniWrite,%psp_menu%,%applicationname%.ini,Settings,psp_menu
IniWrite,%copy_highlighted%,%applicationname%.ini,Settings,copy_highlighted
IniWrite,%clip_boardhelper%,%applicationname%.ini,Settings,clip_boardhelper
IniWrite,%paste_hotkey%,%applicationname%.ini,Settings,paste_hotkey
IniWrite,%togglehotkey%,%applicationname%.ini,Settings,togglehotkey
IniWrite,%middle_click_search%,%applicationname%.ini,Settings,middle_click_search
IniWrite,%typos%,%applicationname%.ini,Settings,typos
IniWrite,%abbreviations%,%applicationname%.ini,Settings,abbreviations
IniWrite,%capslock_change_case%,%applicationname%.ini,Settings,capslock_change_case 
IniWrite,%smartcapslock%,%applicationname%.ini,Settings,smartcapslock
IniWrite,%various_hotkeys%,%applicationname%.ini,Settings,varioushotkeys
IniWrite,%note_logger%,%applicationname%.ini,Settings,note_logger
IniWrite,%note_logger_reserve_screen%,%applicationname%.ini,Settings,note_logger_reserve_screen
IniWrite,%minute_timer%,%applicationname%.ini,Settings,minute_timer
IniWrite,%lunch_length%,%applicationname%.ini,Settings,lunch_length
IniWrite,%break_length%,%applicationname%.ini,Settings,break_length
Return

;#############################
;     Build Tray menu §
;#############################

TRAYMENU:
Menu,Tray,NoStandard 
Menu,Tray,DeleteAll 
Menu,Tray,Add,%applicationname%,ABOUT
Menu,Tray,Add,
; Menu,Tray,Add,Show last &count,SHOWMSGBOXINFO      !!FLAGG INTGRATE THIS WITH COPYSEL!!
; Menu,Tray,Add,
Menu,Tray,Add,&Enabled  %togglehotkey%,SWAPSTATUS
Menu,Tray,Add,&Copy Highlighted,  %FLAGGVARIABLE%,  ;FLAGGDISABLECOPY
Menu,Tray,Add,&Clipboard Helper,  %FLAGGVARIABLE%,  ;FLAGGDISABLECLIPBOARDHELPER

Menu,Tray,Add,&Settings,SETTINGS
Menu,Tray,Add,&About,ABOUT
Menu,Tray,Add,E&xit,EXIT
Menu,Tray,Default,%applicationname%
Menu,Tray,Check,&Enabled
Return

;#############################
;     Build Settings §
;#############################

SETTINGS:
#`::
Gui,2:Destroy
If paste_hotkey<>
  Hotkey,%paste_hotkey%,Off,UseErrorLevel
If togglehotkey<>
  Hotkey,%togglehotkey%,Off,UseErrorLevel
StringReplace,charstoignore,charstoignore,%A_Space%,space
StringReplace,charstoignore,charstoignore,%A_Tab%,tab
StringReplace,charstoignore,charstoignore,`n,newline
StringReplace,charstoignore,charstoignore,`r,carridgereturn
StringReplace,worddelimiters,worddelimiters,%A_Space%,space
StringReplace,worddelimiters,worddelimiters,%A_Tab%,tab
StringReplace,worddelimiters,worddelimiters,`n,newline
StringReplace,worddelimiters,worddelimiters,`r,carridgereturn
StringReplace,linedelimiters,linedelimiters,%A_Space%,space
StringReplace,linedelimiters,linedelimiters,%A_Tab%,tab
StringReplace,linedelimiters,linedelimiters,`n,newline
StringReplace,linedelimiters,linedelimiters,`r,carridgereturn

Gui,2:Margin,30,10
Gui,2:Add,Tab,xm-20 ym w240 h350,Main|Hotkeys|Jumping

Gui,2:Tab,1
Gui,2:Add,GroupBox,xm-10 ym+30 w220 H45,Startup
Gui,2:Add,CheckBox,xm yp+20 vvstart_disabled Checked%start_disabled%,&Start disabled
Gui,2:Add,CheckBox, xp+90 vvstart_with_win Gstart_with_win Checked%start_with_win%,Start with &Windows

;Gui,2:Add,Groupbox,xm-10 y+20 w220 ,Timestamp
Gui,2:Add,GroupBox,xm-10 y+20 w220 h80,Status
Gui,2:Add,CheckBox,xm yp+20 vvshowtraytip Checked%showtraytip%,Show &tray tip
Gui,2:Add,CheckBox,xm y+5 vvshowtooltip Checked%showtooltip%,Show t&ool tip
Gui,2:Add,CheckBox,xm y+5 vvshowmsgbox Checked%showmsgbox%,Show &message box
Gui,2:Add,GroupBox,xm-10 y+20 w220 h50,Time to show tip (seconds)
Gui,2:Add,Edit,xm yp+20 vvtiptime,
Gui,2:Add,UpDown,Limit0-99,%tiptime%

Gui,2:Tab,2
Gui,2:Add,GroupBox,xm-10 ym+30 w220 h70,Disable %applicationname%
Gui,2:Add,Hotkey,xm yp+20 w200 vvtogglehotkey
StringReplace,currenthotkey,togglehotkey,^,Ctrl +%A_Space%
StringReplace,currenthotkey,currenthotkey,!,Alt +%A_Space%
StringReplace,currenthotkey,currenthotkey,+,Shift +%A_Space%
Gui,2:Add,Text,xm y+5,Current hotkey: %currenthotkey%

Gui,2:Add,GroupBox,xm-10 y+20 w220 h220,Paste
Gui,2:Add,Text,xm yp+20,`t* Not all combinations work!
Gui,2:Add,CheckBox,y+5 vvpastectrl,&Ctrl
Gui,2:Add,CheckBox,y+5 vvpastealt,&Alt
Gui,2:Add,CheckBox,y+5 vvpasteshift,S&hift
Gui,2:Add,CheckBox,y+5 vvpasteleft,&Left mousebutton
Gui,2:Add,CheckBox,y+5 vvpastemiddle,&Middle mousebutton
Gui,2:Add,CheckBox,y+5 vvpasteright,&Right mousebutton
Gui,2:Add,Hotkey,y+5 w200 vvpaste_hotkey
StringTrimLeft,currenthotkey,paste_hotkey,1
StringReplace,currenthotkey,currenthotkey,+,Shift +%A_Space%
StringReplace,currenthotkey,currenthotkey,^,Ctrl +%A_Space%
StringReplace,currenthotkey,currenthotkey,!,Alt +%A_Space%
StringReplace,currenthotkey,currenthotkey,&, +%A_Space%
Gui,2:Add,Text,xm y+5 w200,Current hotkey: %currenthotkey%

Gui,2:Tab,3
Gui,2:Add,Text,xm ym+30 w200,Add the characters you want to ignore or use as delimiters. Note the special space, tab, newline (LF), and carridge return (CR)
Gui,2:Add,GroupBox,xm-10 y+10 w220 h80,&Line delimiters
Gui,2:Add,Edit,xm yp+20 w200 h50 vvlinedelimiters,%linedelimiters%
Gui,2:Add,GroupBox,xm-10 y+20 w220 h80,&Word delimiters
Gui,2:Add,Edit,xm yp+20 w200 h50 vvworddelimiters,%worddelimiters%
Gui,2:Add,GroupBox,xm-10 y+20 w220 h80,&Characters to ignore
Gui,2:Add,Edit,xm yp+20 w200 h50 vvcharstoignore,%charstoignore%

Gui,2:Tab
Gui,2:Add,Button,xm-10 y+30 w75 gSETTINGSOK,OK
Gui,2:Add,Button,x+5 yp w75 gSETTINGSCANCEL,Cancel

Gui,2:Show,AutoSize,%applicationname% Settings
Return


SETTINGSOK:
Gui,2:Submit
start_disabled:=vstart_disabled
start_with_win:=vstart_with_win

If vtogglehotkey<>
  togglehotkey:=vtogglehotkey

hotkey=
If vpastectrl=1
  hotkey=%hotkey%^
If vpastealt=1
  hotkey=%hotkey%!
If vpasteshift=1
  hotkey=%hotkey%+
If vpasteleft=1
  hotkey:=hotkey "LButton & "
If vpastemiddle=1
  hotkey:=hotkey "MButton & "
If vpasteright=1
  hotkey:=hotkey "RButton & "
If vpaste_hotkey<>
  hotkey=%hotkey%%vpaste_hotkey%
StringRight,end,hotkey,3
If (end=" & ")
  StringTrimRight,hotkey,hotkey,3  
If hotkey<>
  paste_hotkey=~%hotkey%

Gosub,INIWRITE
Gosub,INIREAD
Gosub,SETTINGSCANCEL
Return


SETTINGSCANCEL:
Gui,2:DESTROY
If paste_hotkey<>
  Hotkey,%paste_hotkey%,PASTE,On UseErrorLevel
If togglehotkey<>
  Hotkey,%togglehotkey%,SWAPSTATUS,On UseErrorLevel
Return

;#############################
;     Build About box §
;#############################

ABOUT:
#a::
hCurs:=DllCall("LoadCursor","UInt",NULL,"Int",32649,"UInt") ;IDC_HAND
OnMessage(0x200,"WM_MOUSEMOVE") 
Gui,3:Destroy
Gui,3:Add,Text,y-5,`t
Gui,3:Add,Picture,xm Icon1,icoN1.ICO
Gui,3:Font,Bold
Gui,3:Add,Text,x+10 yp+10,%applicationname% %VersionDateName%
Gui,3:Font
Gui,3:Add,Text,xm GSETTINGS,- Change the settings by choosing Settings in the Tray menu.
Gui,3:Add,Text,XM,%What_it_does%
Gui,3:Add,Text,, ;y+0,`t

; Gui,3:Add,Picture,xm Icon6,%applicationname%.exe PICTURE FOR MY TAGLINE
; Gui,3:Font,Bold
; Gui,3:Add,Text,,Michael Searcy ; x+10 yp+10
; Gui,3:Font
Gui,3:Add,Text,yp-12,For suggestions, feedback or errors email ; xm
Gui,3:Add,Text,,
Gui,3:Font,CBlue Underline
Gui,3:Add,Text,yp-12 GEMAILDEV,CharterLvlUpDevelopmentTeam@Chartercom.com
Gui,3:Font
Gui,3:Add,Text,, ;y+0,`t

EMAILDEV:
Run,mailto:michael.searcy@chartercom.com?subject=Feedback For %applicationname%.exe`(%VERSIONDATENAME%`)
Return

/*
Gui,3:Add,Picture,xm Icon6,%applicationname%.exe
Gui,3:Font,Bold
Gui,3:Add,Text,yp+10,AutoHotkey ;x+10 
Gui,3:Font
Gui,3:Add,Text,xm,This program was made using AutoHotkey ;xm
Gui,3:Font,CBlue Underline
Gui,3:Add,Text,xm GAUTOHOTKEY,www.AutoHotkey.com
Gui,3:Font
Gui,3:Add,Text,y+0,`t

AUTOHOTKEY:
Run,http://www.autohotkey.com,,UseErrorLevel
Return
*/

Gui,3:Add,Button,GABOUTOK Default w75,&OK
Gui,3:Show,,About %applicationname% 
Return

ABOUTOK:
Gui,3:Destroy
OnMessage(0x200,"") 
DllCall("DestroyCursor","Uint",hCur) 
Return

;#############################
;     Solo Subroutines §
;#############################

SWAPSTATUS:
Menu,Tray,ToggleCheck,&Enabled
Suspend,Toggle
Return

START_WITH_WIN:
If start_with_win 
    IfNotExist %A_Startup%\%applicationname%.lnk
	FileCreateShortcut 
,%A_Scriptfullpath%,%A_Startup%\%applicationname%.lnk,%A_Scriptdir%,,,,
If start_with_win = false
   IfExist %A_Startup%\%applicationname%.lnk
      Filedelete,%A_Startup%\%applicationname%.lnk
return

EXIT:
ExitApp
return

PASTE:
Send,^v
Return

Capslock & R::
Reload


;###############################################################################
;##     End of SubRoute §                                                     ##
;###############################################################################
;to include 
Insert::  ; appends text to clipboard vs replacing it from : http://www.biancolo.com/content_show.cfm/content_id.26596/making_the_insert_key_useful_instead_of_annoying
bak = %clipboard% 
Send, ^c 
clipboard = %bak%`r`n%clipboard% 
return 

; Convert Selection to Lower Case  ; From : http://biancolo.com/content_show.cfm/content_id.27850/quickly_convert_any_selection_to_upper_or_lower_ca
^+-:: 
bak = %clipboard% 
Send, ^c 
StringLower, clipboard, clipboard 
Send, ^v 
clipboard = %bak% 
return 

; Convert Selection to Upper Case 
^+=:: 
bak = %clipboard% 
Send, ^c 
StringUpper, clipboard, clipboard 
Send, ^v 
clipboard = %bak% 
return 

^+t::  ; Title case
bak = %clipboard% 
Send, ^c 
StringUpper, clipboard, clipboard, T 
Send, ^v 
clipboard = %bak% 
return
; This script maps to CTRL-SHIFT-t.


; ##############################################################################



;###############################################################################
;##     UNMODIFIED OLD CODE - TB DELETED AFTER TESTING                        ##  
;###############################################################################
IfExist, Shimanov_CH.ahk
Run, Shimanov_CH.ahk


;:::::::::::::::::::::::::::::::::::::
;: Look Over Suggestions on compile ::
;:::::::::::::::::::::::::::::::::::::
;:::::::::::::::::::::::::::
;: Change Date on compile ::
;:::::::::::::::::::::::::::
FormatTime,VersionDateName,20070125, y.M.dd
SciptVersion := VersionDateName
Gosub, MenuBuild
GoSub, AltTabReplacementer
GoSub, Worklogger
;::::::::::::::::::::::::
;:::&&     TYPOS    &&:::
;::::::::::::::::::::::::
#Include %A_ScriptDir%\typos.ini
;::::::::::::::::::::::::
;:::   MENU BUILD     :::
;::::::::::::::::::::::::
MenuBuild:
Menu, Tray, Tip,%A_ScriptName% v%SciptVersion% `nby Mike Searcy `nDesigned to do all your work for you `n(Work in Progress) `nClick for more info on usage
; Comment OUt Mainwindow on Compile
Menu, tray, MainWindow
Menu, tray, NoStandard
menu, tray, add, Usage
menu, tray, Default, usage
    default = Usage
menu, tray, add, Credits
;menu, tray, add, ChangeLog
;menu, tray, add, Links
Menu, tray,Standard
Return

;::::::::::::::::::::::::
;:::&&     PSP      &&:::
;::::::::::::::::::::::::

#IfWinActive ahk_class com.nortel.telepath.guide.ServOrd.ServOrd
;Query
:*:?::^+{Left}^xQDN ^v {Enter}
;Voicemail A=adds (sent) D=delete (sent) C=Change (left)
:*:+vm::^+{Left}^xADO $ ^vCFDA N NSCR 99 30 FIXRING B99 CFBL N NSCR 99 B99 MWT CMWI Y N N N N $ {Enter}
:*:-vm::^+{Left}^xDEO $ ^vCFDA CFBL MWT $ {Enter}
:*:/vm::^+{Left}^xCHF $ ^vCFDA N NSCR 99 30 FIXRING B99 CFBL N NSCR 99 B99 MWT CMWI Y N N N N $
;10Ft Pk
:*:+10::^+{Left}^xADO $ ^vACRJ INACT CND NOAMA CNAMD NOAMA SCWID CWT SC1 SCF NOAMA INACT $ $ NSCR 99 RING CFW C NSCR 99 DRCW NOAMA INACT $ SCA NOAMA INACT $ N SCRJ NOAMA INACT $ ${Enter}
:*:-10::^+{Left}^xDEO $ ^vACRJ CND CNAMD SCWID CWT SC1 SCF CFW DRCW SCA SCRJ ${Enter}
;Call Waiting
:*:+cw::^+{Left}^xADO $ ^vcwt scwid ${Enter}
:*:-cw::^+{Left}^xDEO $ ^vcwt scwid ${Enter}
;Port
:*:-port::^+{Left}^xDEO $ ^vPORT ${Enter}
;Pics
:*:/pic5::^+{Left}^xCHF $ ^vPIC 5000 Y LPIC 5000 Y ${Enter}
:*:/pic6::^+{Left}^xCHF $ ^vPIC 6323 Y LPIC 6323 Y ${Enter}
:*:/picn::^+{Left}^xCHF $ ^vPIC NILC Y LPIC NILC Y ${Enter}
:*:+iblk::^+{Left}^xADO $ ^vINTPIC NILC Y ${Enter}
:*:-iblk::^+{Left}^xDEO $ ^vINTPIC NILC Y ${Enter}
;Disring
:*:/dis::{Home}^+{Right}^xCHF $ ^vSDN ^{Right}$ 2 P $ $
:*:+dis::{Home}^+{Right}^xADO $ ^vSDN ^{Right}2 N NODNY $ $
:*:-dis::{Home}^+{Right}^xDEO $ ^vSDN ^{Right}$
;tdn
:*:+tdn::^+{Left}^xADO $ ^vTDN ${Enter}
:*:-tdn::^+{Left}^xDEO $ ^vTDN ${Enter}
;3Way Calling
:*:+3wc::^+{Left}^xADO $ ^v3WC ${Enter}
:*:-3wc::^+{Left}^xDEO $ ^v3WC ${Enter}
;Line Treat Grp
:*:/ltg::{Home}^+{Right}^xCLTG $ ^{Right}^v${Enter}
;CID Block
:*:+cidb::^+{Left}^xADO $ ^v suppress public y y $ $ {Enter}
:*:-cidb::^+{Left}^xDEO $ ^v suppress $ {Enter}
;CFW
:*:+cfw::^+{Left}^xADO $ ^v CFW C NSCR 99 $ {Enter}
:*:/cfwa::{Home}^+{Right}^xCHF $ ^vCFW C NSCR 99 A ^{Right}$ {Enter}
:*:/cfwi::^+{Left}^xCHF $ ^vCFW C NSCR 99 I $ $ {Enter}
;The first "$" is for a blank number and the second "$" is to end the command
#IfWinActive Instant Messages
:*:wp::wrong pod sorry{Tab}{Enter}
#IfWinActive ;end ahk_class com.nortel.telepath.guide.ServOrd.ServOrd part


;::::::::::::::::::::::::
;:::    COMM ABBREV   :::
;::::::::::::::::::::::::
:*:``ty::thank you{Space}
:*:``yw::you're welcome{Space}
:*:vmw::voicemail walkthrough cust edu{Space}
:*:``ugm::you've got mail{Space}
:*:ygm::you've got mail{Space}
:*:``np::no problem{Space}
:*:btw::by the way{Space}
:*:brb::be right back{Space}
:*:``nate::need anything else?{Space}
:*:twba::that will be all{Space}
:*:hgd::have a great day{Space}
:*:``ob::I'm on break till{Space}
:*:``ol::I'm on lunch till{Space}
:*:nntr::no need to respond{Space}
:*:pmii::please pod me if you need additional info or if I become inactive as I am taking other calls. thx{Space}
:*:tyvm::thank you very much{Space}
:*:``wtba::will that be all{Space}
:*:``143::I love you{Space}


;::::::::::::::::::::::::
;:::&&  HOTKEYS     &&:::
;::::::::::::::::::::::::

;:::   TIME STAMP     :::

:R*?:]d::
FormatTime,CurrentDateTime, LSys, ddd M/d/yy h:mm tt ; It will look like 12/22/06 2:27 PM
StringUpper, Paste_Name, A_Username,
;TimeZoneDiff := %A_NowUTC%
;EnvSub, TimeZoneDiff, %A_Now%,S
SendInput :%CurrentDateTime% -%Paste_Name%:
return

;:::&&  BREAK ADJ   &&:::

#b::
#Persistent
ToolTip, Loading Break Adjustment for %A_Username%
SetTimer, RemoveBA, 1200
return
RemoveBA:
SetTimer, RemoveBA, Off
ToolTip
Run, http://ccintranet.chartercom.com/home/display/dsp_break_adj_form.cfm?
return

;:::  GOOGLE SEARCH   :::

#g::
AutoTrim Off  ; Retain any leading and trailing whitespace on the clipboard.
ClipboardOld = %ClipboardAll%
Clipboard =  ; Must start off blank for detection to work.
IfWinActive, ahk_class ConsoleWindowClass
    Send, {ENTER}   ; copy selected text in Dos prompt
  else
Send ^c
ClipWait 1
If ErrorLevel
{
Send +{Home}^c
ClipWait 1
}
StringReplace, Hotstring, Clipboard, ``, ````, All  ; Do this replacement first to avoid interfering with the others below.
StringReplace, Hotstring, Hotstring, `r`n, ``r, All  ; Using `r works better than `n in MS Word, etc.
StringReplace, Hotstring, Hotstring, `n, ``r, All
StringReplace, Hotstring, Hotstring, %A_Tab%, ``t, All
StringReplace, Hotstring, Hotstring, `;, ```;, All
StringReplace, HotString, HotString, :,`%3A, All
StringReplace, HotString, HotString, %A_Space%,`%20, All
Clipboard = %ClipboardOld%  ; Restore previous contents of clipboard.
If ( WinActive("ahk_class CabinetWClass")
       Or WinActive("ahk_class ExploreWClass")
       Or WinActive("ahk_class Progman") )  ; File Explorer or Desktop
  {
    SplitPath, Hotstring , Hotstring ; Just use filename, not full path if copied from File Explorer
  }
#Persistent
ToolTip, Sending "%HotString%" to Google Search
SetTimer, RemoveGoogleSearch, 1200
return
RemoveGoogleSearch:
SetTimer, RemoveGoogleSearch, Off
ToolTip
Run, http://www.google.com/search?hl=en&q=%Hotstring%
return

;:::  FEELING LUCKY   :::

#f::
AutoTrim Off  ; Retain any leading and trailing whitespace on the clipboard.
ClipboardOld = %ClipboardAll%
Clipboard =  ; Must start off blank for detection to work.
IfWinActive, ahk_class ConsoleWindowClass
    Send, {ENTER}   ; copy selected text in Dos prompt
  else
Send ^c
ClipWait 1
If ErrorLevel
{
Send +{Home}^c
ClipWait 1
}
StringReplace, Hotstring, Clipboard, ``, ````, All  ; Do this replacement first to avoid interfering with the others below.
StringReplace, Hotstring, Hotstring, `r`n, ``r, All  ; Using `r works better than `n in MS Word, etc.
StringReplace, Hotstring, Hotstring, `n, ``r, All
StringReplace, Hotstring, Hotstring, %A_Tab%, ``t, All
StringReplace, Hotstring, Hotstring, `;, ```;, All
StringReplace, HotString, HotString, :,`%3A, All
StringReplace, HotString, HotString, %A_Space%,`%20, All
Clipboard = %ClipboardOld%  ; Restore previous contents of clipboard.
If ( WinActive("ahk_class CabinetWClass")
       Or WinActive("ahk_class ExploreWClass")
       Or WinActive("ahk_class Progman") )  ; File Explorer or Desktop
  {
    SplitPath, Hotstring , Hotstring ; Just use filename, not full path if copied from File Explorer
  }
#Persistent
ToolTip, Loading most likely result for "%HotString%" from Google
SetTimer, RemoveFLtooltip, 1200
return
RemoveFLtooltip:
SetTimer, RemoveFLtooltip, Off
ToolTip
Run, http://www.google.com/search?hl=en&btnI=I'm+Feeling+Lucky&q=%Hotstring%
return

;:::&&  MARKS PAGE  &&:::

#t::
#Persistent
ToolTip, Loading Telephone Market Info Page by Mark Travers
SetTimer, RemoveTMIPAGETooltip, 1200
return
RemoveTMIPAGETooltip:
SetTimer, RemoveTMIPAGETooltip, Off
ToolTip
Run, http://infonet/personal/mtravers/Shared`%20`Documents/telephone`%20`information/telephone`%20`market`%20`info.htm
return

;::::::::::::::::::::::::
;::  MENUS AND BUTTONS ::
;::::::::::::::::::::::::

;;;;; CREDITS ;;;;;;;

credits:
MsgBox,4,Credits,
(
Charter Short Hand
     ========
     Created with
AutoHotkey Version: 1.0.46.4
www.autohotkey.com
     ========
Author:         Michael Searcy <michael.searcy@chartercom.com>
Version 7.1.5 Thu 1/4/07 4:36 PM Compiled for Charter Communications
FOR CHARTER EMPLOYEES ONLY
This is used to automatically replace text with other text.
For example "btw" becomes "by the way" as soon as you hit space.

Thanks to:
Jim Biancolo <http://www.biancolo.com> for Compiling Wikipedia list of common mispelled words
Josh Linke for Suggestions on Gui Navigation

Would You like to be notified of new Versions?
)
IfMsgBox Yes
Run, http://infonet/personal/msearcy/TTMLOUISVILLECOMMPAGE/HigH_Tech/CharterShortHandBeta/_layouts/1033/SubNew.aspx?List={FBD79947-97A8-41C0-835D-43F1A43BE4BB}
return

;:::&&  USAGE BOX   &&:::

;#`::  ;Win Tilde hotkey
Usage: ;Build Gui tabs
GoSub, CloseLilGuis
Gui, 98: Add, Tab, w420 h500 -wrap, &Main Use|&PSP Codes|&Web Browsing|&Txt Expander

;Start first Tab
Gui, 98: Font,, Verdana
Gui, 98: Add, edit, r29 readonly, Charter AutoReplace Scripts `n------------------------ `n*Billing System notes `n------------------------ `nTime Stamp with user name! `nJust Type: ]d    (the rightmost bracket and d) `n`n---------------`n*Fix mispelled words & typos`n-------------------------`nJust spell the word and if its wrong it will be replaced (Possibly)`n`n
;------------------------------------------ `nCustomize with  your own mispellings/macros `n(Comming Soon) `n------------------------------------------ `nSimply highlight what you want to replace `nand hit the windows key [WIN]+H
Gui, 98: Add, Button, , &Ok
Gui, 98: Add, Text, , Send Suggestions to:
Gui, 98: Font, CRed Bold Underline,
Gui, 98: Add, Text, cBlue gSuggestionsLink , michael.searcy@chartercom.com

;Psp tab
Gui, 98: Tab, &PSP Codes
Gui, 98: Font, Norm cBlack,
Gui, 98: Add, Edit, r29 readonly , -----------------------------------------------------------------`nPSP (enter # first then command. ie. 5024207200 qdn]`n-----------------------------------------------------------------`nLegend A=add (sent) D=delete (sent) C=Change (remains open)`n#=Main TN#   2#=Secondary TN# (Disring or Forwarding #)`nLtg=Line Treatment group`n[Command    :  Type]   HINT*  Use the Numpad`nQuery`n - Query #               :  #    ?`n10Ft Pk`n - Add 10F               :  # +10`n - Delete 10F           :  # -10`n3 Way Calling`n - Add 3WC              :  # +3wc`n - Delete 3WC          :  # -3wc`nCall Forward Variable`n - Add CFW             : # +cfw`n - Change CFW Inact: # /cfwi  <-- I=Inactive (takes away 2nd #)`n - Change CFW Act   : # 2# /cfwa <-- A=Active`nCall Waiting `n - Add Call Wait       : # +cwt`n - Del Call Wait        : # -cwt`nCID Block`n - Block Caller ID      : # +cidb`n - Delete CID Block   : # -cidb`nDistintive ring`n - Add Disring           : # 2# +dis `n - Change Disring      : # 2# /dis`n - Delete Disring        : # 2# -dis`nLine Treat Grp`n - Change LTG           : # ltg# /ltg`nPics`n - Set to 5000           : # /pic5`n - Set to 6323           : # /pic6`n - Change to none     : # /picn`n - Add Intnt'l Blk       : # +iblk`n - Del Intnt'l Blk        : # -iblk`nPort`n - Delete Port            :  # -port`nVoicemail `n - Add VM                 :  # +vm]`n - Delete VM             :  # -vm`n - Change VM            :  # /vm]
Gui, 98: Add, Button, , &Ok
Gui, 98: Add, Text, , Send Suggestions to:
Gui, 98: Font, CRed Bold Underline,
Gui, 98: Add, Text, cBlue gSuggestionsLink , michael.searcy@chartercom.com

;Web Browsing tab
Gui, 98: Tab, &Web Browsing
Gui, 98: Font, Norm S8 CBlack, Verdana
Gui, 98: Add, edit , r29 readonly, -----------------`nWeb Browsing`n-----------------`nBreak Adjustment (Louisville Only as of now)  : [Win]+B`nGoogle Search (Regular)                            : [Win]+G`nGoogle Search (First Result/Feeling Lucky)   : [Win]+F`nGoogle searches work either with any highlighted text`n or in an empty browser`nMarks Page (Telephone Market Info Page)     : [Ctrl]+t
Gui, 98: Add, Button, , &Ok
Gui, 98: Add, Text, , Send Suggestions to:
Gui, 98: Font, CRed Bold Underline,
Gui, 98: Add, Text, cBlue gSuggestionsLink , michael.searcy@chartercom.com

;TxtExpander Tab
Gui, 98: Tab, &Txt Expander
Gui, 98: Font, Norm S8 CBlack, Verdana
Gui, 98: Add, edit , r29 readonly, -----------------------`n*Common Abbreviations`n-----------------------`nyou've got mail        : ygm                               `nno problem              : np]`nby the way              : btw`nbe right back           : brb`nneed anything else? : nate]`nthat will be all         : twba`nhave a great day      : hgd`nI'm on break till       : ob]`nI'm on lunch till       : ol]`nno need to respond  : nntr`nthank you very much: tyvm`n`nplease pod me if you`nneed additional info`nor if I become inactive `nas I am taking other `ncalls. thx                : pmii
Gui, 98: Add, Button, , &Ok
Gui, 98: Add, Text, , Send Suggestions to:
Gui, 98: Font, CRed Bold Underline,
Gui, 98: Add, Text, cBlue gSuggestionsLink , michael.searcy@chartercom.com
Gui ,98: Show, , Usage Help   ** Hit [Win] + `` (above tab)
return

98GuiCLose:
98GuiEscape:
97GuiClose:
97GuiEscape:
CloseLilGuis:
Gui, 98: Destroy
Gui, 97: Destroy
Sleep, 500
WinwaitClose,
return

SuggestionsLink:
Run mailto:michael.searcy@chartercom.com?subject=Suggestions For Charter Short Hand
return

98ButtonOk:
GoSub, CloseLilGuis
return


Worklogger:
#Include, Worklogger.ahk
Return